
export function filterTime(val) {
  // console.log(val)

  var date = new Date(val);
  var YY = date.getFullYear() + '-';
  var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  var DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
  var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
  var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
  var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
  return YY + MM + DD +" "+hh + mm + ss;

}
export function nowDay(){
  const currentDate = new Date();
const year = currentDate.getFullYear();
const month = (currentDate.getMonth() + 1).toString().padStart(2,0); // 月份是从 0 开始计数的，因此要加1
const day = currentDate.getDate().toString().padStart(2,0);
return `${year}-${month}-${day}`
}
export function filterStatus(val,arr){
  if(arr && arr.length>0){
    return arr.filter(item=>item.id == val)[0]?arr.filter(item=>item.id == val)[0].name:''
  }
}
